feat: φ-optimized FMA operations for GF16#55
Closed
gHashTag wants to merge 1 commit into
Closed
Conversation
Add fused arithmetic to GF16 struct: - fma(a,b,c): a*b+c (single rounding) - fms(a,b,c): a*b-c - fnma(a,b,c): c-a*b (negated FMA) - phiFma(a,b,c): φ-weighted FMA with golden-ratio scaling - phiDot(a,b): φ-optimized dot product over slices Export via C-ABI (gf16_fms, gf16_fnma, gf16_phi_fma) and declare in gf16.h header. Add 5 new unit tests. Closes #4
Owner
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements issue #4 — φ-optimized fused multiply-add operations.
GF16 struct additions (
src/formats/golden_float16.zig):fma(a,b,c)— fused multiply-add: a×b+c (single rounding)fms(a,b,c)— fused multiply-subtract: a×b-cfnma(a,b,c)— fused negated multiply-add: c-a×bphiFma(a,b,c)— φ-weighted FMA with golden-ratio scaling (×φ²)phiDot(a,b)— φ-optimized dot product over slicesC-ABI exports (
src/c_abi.zig):gf16_fms,gf16_fnma,gf16_phi_fmaC header (
src/c/gf16.h): declares all new functionsTests: 5 new tests for FMA, FMS, FNMA, phiFMA, phiDot
Closes #4